/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.hazard.process.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.admin.api.resolver.enums.SysDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 危险工艺
 *
 * @author daijie
 * @date 2023-11-10 16:01:14
 */
@Data
@TableName("haz_process")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "危险工艺")
public class HazProcessEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "标识")
    private Long id;

    /**
     * 工艺名称
     */
    @Schema(description = "工艺名称")
    private String processName;
    /**
     * 工艺类型
     */
    @Schema(description = "工艺类型")
    private String processType;

    /**
     * 工艺编码
     */
    @Schema(description = "工艺编码")
    private String processCode;

    /**
     * 装置名
     */
    @Schema(description = "装置名")
    private String deviceName;

    /**
     * 装置规模
     */
    @Schema(description = "装置规模")
    private String deviceSpec;

    /**
     * 重点监控单元
     */
    @Schema(description = "重点监控单元")
    private String keyMonitorUnit;

    /**
     * 工艺危险特性
     */
    @Schema(description = "工艺危险特性")
    private String processFeatures;

    /**
     * 工艺装置所在地址
     */
    @Schema(description = "工艺装置所在地址")
    private String deviceLocation;

    /**
     * 投用时间
     */
    @Schema(description = "投用时间")
    private Date useDate;

    /**
     * 自动化控制
     */
    @Schema(description = "自动化控制")
    private Boolean autoControlFlag;

    /**
     * 安全仪表系统是否投用
     */
    @Schema(description = "安全仪表系统是否投用")
    private Boolean sisFlag;

    /**
     * 是否展开风险评估
     */
    @Schema(description = "是否展开风险评估")
    private Boolean riskFlag;

    /**
     * 是否满足国家规定要求
     */
    @Schema(description = "是否满足国家规定要求")
    private Boolean meetRequirementFlag;

    /**
     * 是否重点监管化工工艺
     */
    @Schema(description = "是否重点监管化工工艺")
    private Boolean regulatoryProcessFlag;

    /**
     * 技术来源
     */
    @Schema(description = "技术来源")
    private String technologySource;

    /**
     * 中间产品
     */
    @Schema(description = "中间产品")
    private String intermediateProduct;

    /**
     * 中间产品物质形态
     */
    @Schema(description = "中间产品物质形态")
    private String intermediateProductForm;

    /**
     * 最终产品
     */
    @Schema(description = "最终产品")
    private String finalProduct;

    /**
     * 最终产品物质形态
     */
    @Schema(description = "最终产品物质形态")
    private String finalProductFrom;

    /**
     * 设计单位
     */
    @Schema(description = "设计单位")
    private String designUnit;

    /**
     * 设计单位资质等级
     */
    @Schema(description = "设计单位资质等级")
    private String designQualificationLevel;

    /**
     * 经度
     */
    @Schema(description = "经度")
    private String longitude;

    /**
     * 纬度
     */
    @Schema(description = "纬度")
    private String latitude;

    /**
     * 高度
     */
    @Schema(description = "高度")
    private String altitude;

    /**
     * 定位
     */
    @Schema(description = "定位")
    private String hazardSourceLocation;

    /**
     * 范围
     */
    @Schema(description = "范围")
    private String hazardSourceScope;

    /**
     * 岗位操作人数
     */
    @Schema(description = "岗位操作人数")
    private Integer operatorNumber;

    /**
     * 持证人数
     */
    @Schema(description = "持证人数")
    private Integer holderNumber;

    /**
     * 反应类型
     */
    @Schema(description = "反应类型")
    private String reactionType;

    /**
     * 工艺系统简况
     */
    @Schema(description = "工艺系统简况")
    private String processDesc;

    /**
     * 危险性描述
     */
    @Schema(description = "危险性描述")
    private String riskDesc;

    /**
     * 重点监控工艺参数
     */
    @Schema(description = "重点监控工艺参数")
    private String monitorParam;

    /**
     * 控制措施
     */
    @Schema(description = "控制措施")
    private String controlMeasures;

    /**
     * 近三年内事故情况
     */
    @Schema(description = "近三年内事故情况")
    private String accidentSituation;

    /**
     * 工艺流程图
     */
    @Schema(description = "工艺流程图")
    private String img;

    /**
     * 登记状态
     */
    @Schema(description = "登记状态")
    private String registerStatus;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    private Long orgId;

    public String getOrgIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.orgId);
    }

    public String getRegisterStatusStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.hazard_process_status, this.registerStatus);
    }

    public String getAutoControlFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.autoControlFlag);
    }

    public String getSisFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.sisFlag);
    }

    public String getRiskFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.riskFlag);
    }

    public String getRegulatoryProcessFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.regulatoryProcessFlag);
    }

    public String getProcessTypeStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.hazard_chemical_process, this.processType);
    }
}
